package com.guopiao.vat.common.general.exception;


/**
 *  
 *  * @Author: Xander Xiao
 *  * @Description:  自定义统一异常类
 *  @Date:Create in 2017/12/26
 *  
 */

public class VATException extends RuntimeException{
    /*请求唯一标识*/
    private String requestId;
    /*请求返回代码*/
    private String rtnCode;
    /*请求返回信息 */
    private String rtnMsg;
    /*请求返回业务内容*/
    private Object rtnData;

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getRtnCode() {
        return rtnCode;
    }

    public void setRtnCode(String rtnCode) {
        this.rtnCode = rtnCode;
    }

    public String getRtnMsg() {
        return rtnMsg;
    }

    public void setRtnMsg(String rtnMsg) {
        this.rtnMsg = rtnMsg;
    }

    public Object getRtnData() {
        return rtnData;
    }

    public void setRtnData(Object rtnData) {
        this.rtnData = rtnData;
    }

    @Override public  String getMessage(){
        return  rtnMsg;
    }

    public VATException(){}

    public VATException(String requestId, String code, String msg, Throwable cause){
        super(cause);
        this.requestId=requestId;
        this.rtnMsg=msg;
        this.rtnCode=code;
    }

    public   Object getResponsBody(){
        VATException VATException =new VATException();
        VATException.setRtnCode(rtnCode);
        VATException.setRtnMsg(rtnCode);
        VATException.setRequestId(requestId);
        return VATException;
    }
}
